<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
        typeof
        缺点：对象 null 和 函数之外对象类型无效。
      */
      console.log(typeof 1); //number
      console.log(typeof "hello"); //string
      console.log(typeof true); //boolean
      console.log(typeof function () {}); //function
      console.log(typeof undefined); //undefined
      console.log(typeof null); //object
      console.log(typeof {}); //object
      console.log(typeof []); //object
    </script>
  </body>
</html>
